﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="cliente.aspx.cs" Inherits="Intrack.cliente" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:MultiView ID="mvClientes" runat="server">
        <asp:View ID="vwListaClientes" runat="server">
            <asp:LinkButton ID="lkNovoCliente" runat="server" onclick="lkNovoCliente_Click">Novo Cliente</asp:LinkButton>
            <asp:GridView ID="gvListaClientes" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" 
                GridLines="None" onrowcommand="gvListaClientes_RowCommand" Width="839px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="idCliente" HeaderText="idCliente" 
                        SortExpression="idCliente" >
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" Width="75px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Nome" SortExpression="Nome">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Nome") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" 
                                CommandArgument='<%# Bind("idCliente") %>' CommandName="select" 
                                Text='<%# Bind("Nome") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Endereco" HeaderText="Endereço" 
                        SortExpression="Endereco" />
                    <asp:BoundField DataField="Latit" HeaderText="Latitude" 
                        SortExpression="Latit" />
                    <asp:BoundField DataField="Longi" HeaderText="Longitude" 
                        SortExpression="Longi" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButton1" runat="server" 
                                CommandArgument='<%# Bind("idCliente") %>' CommandName="excluir" 
                                ImageUrl="~/Imgs/delete.png" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <SortedAscendingCellStyle BackColor="#FDF5AC" />
                <SortedAscendingHeaderStyle BackColor="#4D0000" />
                <SortedDescendingCellStyle BackColor="#FCF6C0" />
                <SortedDescendingHeaderStyle BackColor="#820000" />
            </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                SelectMethod="Listar" TypeName="Intrack.BLLCliente"></asp:ObjectDataSource>
            <br />
        </asp:View>
        <asp:View ID="vwCadastroCliente" runat="server">
            <asp:LinkButton ID="lbVoltar" runat="server" onclick="lbVoltar_Click">Voltar</asp:LinkButton>
            <br />
            <asp:Label ID="lblNome" runat="server" Text="Nome"></asp:Label>
            :
            <asp:TextBox ID="txtNome" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label2" runat="server" Text="Endereço"></asp:Label>
            :
            <asp:TextBox ID="txtEndereco" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label4" runat="server" Text="Lati."></asp:Label>
            :
            <asp:TextBox ID="txtLati" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label3" runat="server" Text="Long."></asp:Label>
            :<asp:TextBox ID="txtLong" runat="server"></asp:TextBox>
            <br />
            <asp:Button ID="btnGravar" runat="server" onclick="btnGravar_Click" 
                Text="Gravar" />
            <asp:HiddenField ID="hdIdCliente" runat="server" />
            <asp:Label ID="lblMsgAlerta" runat="server" Font-Bold="False" Font-Size="8pt" 
                ForeColor="Red"></asp:Label>
        </asp:View>
    </asp:MultiView>
    </asp:Content>
